var h = $(window).height();
$(function () {
    $('.row-hoof').css({minHeight: h, backgroundColor: '#d5dbe7'});
    $(window).resize(function(){
        h = $(window).height();
        $('.row-hoof').css({minHeight: h, backgroundColor: '#d5dbe7'});
    })
    if(window.location.search.split('=')[1]){
        changekind(1,window.location.search.split('=')[1]);
    }else{
        changekind($('.title li').eq(0));
    }
})
//指令通过
function checkOrder(item){
    var index = $(item).parent().index();
    $.ajax({
        type: 'post',
        url: baseUrls + 'checkCommand',
        data: {
            userId: $('#userId').val(),
            comid: $(item).parents('li').find('.comid').val(),
            checkstatus: 1,
            checkdesc: "",
        },
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                $(item).parents('li').children('.status-hoof').children('.statusList:eq(' + index + ')').css('visibility','visible').html('通过');
                $(item).parent().html('<i class="fa fa-check check" aria-hidden="true"></i>');
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//指令拒绝
function msgSures(item){
    var str = $(item).parent().children('.Input').val();
    var index = $(item).parent().parent().index();
    $.ajax({
        type: 'post',
        url: baseUrls + 'checkCommand',
        data: {
            userId: $('#userId').val(),
            comid: $(item).parents('li').find('.comid').val(),
            checkstatus: 2,
            checkdesc: str,
        },
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                $(item).parents('li').children('.edit-hoof').children('.editList:eq(' + index + ')').html('<i class="fa fa-times times" aria-hidden="true"></i>');
                if($.trim(str).length > 0){
                    $(item).parent().html('<p>驳回： '+ str +'</p>');
                }else{
                    $(item).parent().html('<p>驳回</p>');
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}

//线索通过
function checkClue(item){
    var index = $(item).parent().index();
    $.ajax({
        type: 'post',
        url: baseUrls + 'clueCheck/add',
        data: {
            qzbh: $(item).parents('li').children('.clue-hoof').children('.clueList:eq(' + index +')').children('.qzbh').val(),
            qzmc: $(item).parents('li').children('.clue-hoof').children('.clueList:eq(' + index +')').children('.qzmc').val(),
            ajbh: $(item).parents('li').children('.clue-hoof').children('.clueList:eq(' + index +')').children('.ajbh').val(),
            ajmc: $(item).parents('li').children('.clue-hoof').children('.clueList:eq(' + index +')').children('.ajmc').val(),
            lrr: $(item).parents('li').children('.entry-hoof').children('.entryList:eq(' + index +')').html(),
            checkdesc: "",
            checker: $('#userId').val(),
            checkstatus: 2
        },
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                $(item).parents('li').children('.status-hoof').children('.statusList:eq(' + index + ')').css('visibility','visible').html('通过');
                $(item).parent().html('<i class="fa fa-check check" aria-hidden="true"></i>');
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//线索拒绝
function msgSure(item){
    var str = $(item).parent().children('.Input').val();
    var index = $(item).parent().parent().index();
    $.ajax({
        type: 'post',
        url: baseUrls + 'clueCheck/add',
        data: {qzbh: $(item).parents('li').children('.clue-hoof').children('.clueList:eq(' + index +')').children('.qzbh').val(), qzmc: $(item).parents('li').children('.clue-hoof').children('.clueList:eq(' + index +')').children('.qzmc').val(), ajbh: $(item).parents('li').children('.clue-hoof').children('.clueList:eq(' + index +')').children('.ajbh').val(), ajmc: $(item).parents('li').children('.clue-hoof').children('.clueList:eq(' + index +')').children('.ajmc').val(), lrr: $(item).parents('li').children('.entry-hoof').children('.entryList:eq(' + index +')').html(), checkdesc: $.trim(str), checker: $('#userId').val(),checkstatus: 3},
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                $(item).parents('li').children('.edit-hoof').children('.editList:eq(' + index + ')').html('<i class="fa fa-times times" aria-hidden="true"></i>');
                if($.trim(str).length > 0){
                    $(item).parent().html('<p>驳回： '+ str +'</p>');
                }else{
                    $(item).parent().html('<p>驳回</p>');
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//串并通过
function caseCodeOrder(item){
    var index = $(item).parent().index();
    $.ajax({
        type: 'put',
        url: baseUrls + 'homepage/glaj',
        contentType: "application/json",
        dataType: "json",
        data: JSON.stringify({
            userId: $('#userId').val(),
            glbh: $(item).parents('li').find('.comid').val(),
            xgr: $('#userId').val(),
            shr: $('#userId').val(),
            shzt: 2,
            shyj: "",
        }),
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                $(item).parents('li').children('.status-hoof').children('.statusList:eq(' + index + ')').css('visibility','visible').html('通过');
                $(item).parent().html('<i class="fa fa-check check" aria-hidden="true"></i>');
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//串并拒绝
function caseCodeMsgSure(item){
    var str = $(item).parent().children('.Input').val();
    var index = $(item).parent().parent().index();
    $.ajax({
        type: 'put',
        url: baseUrls + 'homepage/glaj',
        contentType: "application/json",
        dataType: "json",
        data: JSON.stringify({
            userId: $('#userId').val(),
            glbh: $(item).parents('li').find('.comid').val(),
            xgr: $('#userId').val(),
            shr: $('#userId').val(),
            shzt: 3,
            shyj: $.trim(str),
        }),
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                $(item).parents('li').children('.edit-hoof').children('.editList:eq(' + index + ')').html('<i class="fa fa-times times" aria-hidden="true"></i>');
                if($.trim(str).length > 0){
                    $(item).parent().html('<p>驳回： '+ str +'</p>');
                }else{
                    $(item).parent().html('<p>驳回</p>');
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//打开操作
function refusedClue(item){
    var index = $(item).parent().index();
    $(item).parents('li').children('.status-hoof').children('.statusList:eq(' + index + ')').css('visibility','visible');
    $(item).parent().html('<i class="fa fa-question question" aria-hidden="true" ></i>');
}
//操作取消
function msgCancel(item){
    var index = $(item).parent().parent().index();
    $(item).parents('li').children('.edit-hoof').children('.editList:eq(' + index + ')').html('<i class="fa fa-check check" aria-hidden="true" onclick="checkClue(this)"></i>&nbsp&nbsp<i class="fa fa-times times" aria-hidden="true" onclick="refusedClue(this)"></i>');
    $(item).parent().parent().css('visibility','hidden');
    $(item).parent().find('input').val('');
}
function showDetail(qzbh){
    layer.open({
        type: 2,
        area: ['90%', h * 0.9 + 'px'],
        fixed: false, //不固定
        maxmin: false,
        content: 'layer/layer.html?' + qzbh + '&' + $('#userId').val()
    });

}
function nulls(item){
    var callback;
    if(item != null && item != undefined){
        callback = item;
    } else {
        callback = '无';
    }
    return callback;
}
//tab切换
function changekind(item,type){
    if(type){
        $('.title li').eq(type).addClass('active').removeClass('normal').siblings().addClass('normal').removeClass('active');
        if(type == 0){
            $('.commonExamine').eq(0).show();
            $('.commonExamine').eq(1).hide();
            $('.commonExamine').eq(2).hide();
            getInfo();
            historyInfo();
        }
        if(type == 1){
            $('.commonExamine').eq(0).hide();
            $('.commonExamine').eq(2).hide();
            $('.commonExamine').eq(1).show();
            commandCheckList();
            commandCheckRecord();
        }
        if(type == 2){
            $('.commonExamine').eq(0).hide();
            $('.commonExamine').eq(1).hide();
            $('.commonExamine').eq(2).show();
            caseCodeCheckList();
            caseCodeCheckRecord();
        }
    }else{
        if($(item).hasClass('active')){
        }else{
            $(item).addClass('active').removeClass('normal');
            $(item).siblings().addClass('normal').removeClass('active');
            if($(item).index() == 0){
                $('.commonExamine').eq(0).show();
                $('.commonExamine').eq(1).hide();
                $('.commonExamine').eq(2).hide();
                getInfo();
                historyInfo();
            }
            if($(item).index() == 1){
                $('.commonExamine').eq(0).hide();
                $('.commonExamine').eq(1).show();
                $('.commonExamine').eq(2).hide();
                commandCheckList();
                commandCheckRecord();
            }
            if($(item).index() == 2){
                $('.commonExamine').eq(0).hide();
                $('.commonExamine').eq(1).hide();
                $('.commonExamine').eq(2).show();
                caseCodeCheckList();
                caseCodeCheckRecord();
            }
        }
    }
}
function nofind(item){
    item.src = 'common/img/nothing.png';
    item.onerror = null;
}
function valLength(item){
    var length = $(item).val().length;
    if(length >= $(item).attr('maxlength')){
        Msg('最多允许输入'+ $(item).attr("maxlength") +'个字符');
    }
}
//线索列表
function getInfo(){
    var orgId = $('#orgId').val();
    if($('#orgLevel').val() == 2){
        orgId = $('#parentId').val();
    }
    $.ajax({
        type: 'get',
        url: baseUrls + 'clueCheck/checkingList',
        data: {
            orgId: orgId,
            pageIndex: 1,
            pageSize: 5
        },
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                if(response.content.list.length > 0){
                    $('.firstContent-hoof').html('');
                    for(var i = 0; i < response.content.list.length; i++){
                        var clue = '',
                            entry  = '',
                            edit = '',
                            status = '';
                        for(var j = 0; j < response.content.list[i].clueList.length; j++){
                            clue += '<span class="clueList"  onclick="showDetail(\''+ response.content.list[i].ajbh +'\')">' + nulls(response.content.list[i].clueList[j].qzmc)+'<input type="hidden" class="ajbh" value="'+ response.content.list[i].ajbh +'"><input type="hidden" class="ajmc" value="'+ response.content.list[i].ajmc +'"><input type="hidden" class="qzbh" value="'+ response.content.list[i].clueList[j].qzbh +'"><input type="hidden" class="qzmc" value="'+ response.content.list[i].clueList[j].qzmc +'"><input type="hidden" class="lrr" value="'+ response.content.list[i].clueList[j].lrrid +'"> </span>';
                            entry += '<span class="entryList">' + nulls(response.content.list[i].clueList[j].lrrname) + '</span>';
                            edit += '<span class="editList"><i class="fa fa-check check" aria-hidden="true" onclick="checkClue(this)"></i>&nbsp&nbsp<i class="fa fa-times times" aria-hidden="true" onclick="refusedClue(this)"></i></span>';
                            status += '<div class="statusList"><div class="form-group"><input type="text" placeholder="重新录入,线索附件不全" maxlength="30" class="form-control Input" onkeyup="valLength(this)"><label class="Labels LabelFirst" onclick="msgSure(this)">确定</label><label class="Labels" onclick="msgCancel(this)">取消</label></div></div>';
                        }
                        $('.firstContent-hoof').append('<li><div class="list list-hoof">' + (i+1) + '</div><div class="clueName clueName-hoof">' + response.content.list[i].ajmc + '</div><div class="clue clue-hoof">' + clue + '</div><div class="entry entry-hoof">' + entry + '</div><div class="edit edit-hoof">' + edit + '</div><div class="status status-hoof">' + status + '</div></li>');
                    }
                    for(var i = 0; i < $('.clue-hoof').length; i++){
                        $('.clue-hoof:eq(' + i + ')').parent().children('.list-hoof').css({height: $('.clue-hoof:eq(' + i + ')').height() + 'px',lineHeight: $('.clue-hoof:eq(' + i + ')').height() + 'px'});
                        $('.clue-hoof:eq(' + i + ')').parent().children('.clueName-hoof').css({height: $('.clue-hoof:eq(' + i + ')').height() + 'px',lineHeight: $('.clue-hoof:eq(' + i + ')').height() + 'px'});
                    }
                    $('#demo_pag1').bs_pagination({
                        totalPages: response.content.pages,
                        visiblePageLinks: 8,
                        currentPage: response.content.pageNum,
                        showGoToPage: false,
                        showRowsPerPage: false,
                        showRowsInfo: false,
                        showRowsDefaultInfo: false,
                        navListContainerClass: 'col-xs-12',
                        onChangePage: function (event, data) {
                            $.ajax({
                                type: 'get',
                                url: baseUrls + 'clueCheck/checkingList',
                                data: {orgId: orgId,pageIndex: data.currentPage,pageSize: 5},
                                beforeSend: function(){
                                    Loading();
                                },
                                success: function(response){
                                    closeLoading();
                                    if(response.responseCode == '1000'){
                                        if(response.content.list.length > 0){
                                            $('.firstContent-hoof').html('');
                                            for(var i = 0; i < response.content.list.length; i++){
                                                var clue = '',
                                                    entry  = '',
                                                    edit = '',
                                                    status = '';
                                                for(var j = 0; j < response.content.list[i].clueList.length; j++){
                                                    clue += '<span class="clueList"  onclick="showDetail(\''+ response.content.list[i].ajbh +'\')">' + nulls(response.content.list[i].clueList[j].qzmc)+'<input type="hidden" class="ajbh" value="'+ response.content.list[i].ajbh +'"><input type="hidden" class="ajmc" value="'+ response.content.list[i].ajmc +'"><input type="hidden" class="qzbh" value="'+ response.content.list[i].clueList[j].qzbh +'"><input type="hidden" class="qzmc" value="'+ response.content.list[i].clueList[j].qzmc +'"><input type="hidden" class="lrr" value="'+ response.content.list[i].clueList[j].lrrid +'"> </span>';
                                                    entry += '<span class="entryList">' + nulls(response.content.list[i].clueList[j].lrrname) + '</span>';
                                                    edit += '<span class="editList"><i class="fa fa-check check" aria-hidden="true" onclick="checkClue(this)"></i>&nbsp&nbsp<i class="fa fa-times times" aria-hidden="true" onclick="refusedClue(this)"></i></span>';
                                                    status += '<div class="statusList"><div class="form-group"><input type="text" placeholder="重新录入,线索附件不全" maxlength="30" class="form-control Input" onkeyup="valLength(this)"><label class="Labels LabelFirst" onclick="msgSure(this)">确定</label><label class="Labels" onclick="msgCancel(this)">取消</label></div></div>';
                                                }
                                                $('.firstContent-hoof').append('<li><div class="list list-hoof">' + (i+1) + '</div><div class="clueName clueName-hoof">' + response.content.list[i].ajmc + '</div><div class="clue clue-hoof">' + clue + '</div><div class="entry entry-hoof">' + entry + '</div><div class="edit edit-hoof">' + edit + '</div><div class="status status-hoof">' + status + '</div></li>');
                                            }
                                            for(var i = 0; i < $('.clue-hoof').length; i++){
                                                $('.clue-hoof:eq(' + i + ')').parent().children('.list-hoof').css({height: $('.clue-hoof:eq(' + i + ')').height() + 'px',lineHeight: $('.clue-hoof:eq(' + i + ')').height() + 'px'});
                                                $('.clue-hoof:eq(' + i + ')').parent().children('.clueName-hoof').css({height: $('.clue-hoof:eq(' + i + ')').height() + 'px',lineHeight: $('.clue-hoof:eq(' + i + ')').height() + 'px'});
                                            }
                                        }else{
                                            // $('.firstContent-hoof').css('display','none');
                                            $('#demo_pag1').html('');
                                         //   Msg('暂无数据');
                                        }
                                    }else{
                                        Msg();
                                    }
                                },
                                error: function(){
                                    closeLoading();
                                    Msg();
                                }
                            })
                        }
                    });
                }else{
                    $('.firstContent-hoof').html('');
                    $('#demo_pag1').html('');
                 //   Msg('暂无数据');
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//线索历史列表
function historyInfo(){
    $('.secondContent-hoof').css({height: h - 630 + 'px'});
    var length = Math.floor($('.secondContent-hoof').height() / 49);
    $.ajax({
        type: 'get',
        url: baseUrls + 'clueCheck/checkOrder',
        data: {userid: $('#userId').val(),checktime: $('.Select').val(), lrrname: $.trim($('#Input').val()),pageIndex: 1,pageSize: length},
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                if(response.content.list.length > 0){
                    $('.secondContent-hoof').html('');
                    for(var i = 0; i < response.content.list.length; i++){
                        var clue = '',
                            entry  = '',
                            status = '';
                        for(var j = 0; j < response.content.list[i].clueList.length; j++){
                            clue += '<span class="clueList"  onclick="showDetail(\''+ response.content.list[i].ajbh +'\')">' + nulls(response.content.list[i].clueList[j].qzmc)+'</span>';
                            entry += '<span class="entryList">' + nulls(response.content.list[i].clueList[j].lrrname) + '</span>';
                            if(response.content.list[i].clueList[j].checkstatus == '2'){
                                status += '<span class="statusList statusLists">通过</span>';
                            }else{
                                if(response.content.list[i].clueList[j].checkdesc != null){
                                    status += '<span class="statusList statusLists rejectSpan">驳回：'+ response.content.list[i].clueList[j].checkdesc +'</span>';
                                }else{
                                    status += '<span class="statusList statusLists rejectSpan">驳回</span>';
                                }
                            }
                        }
                        $('.secondContent-hoof').append('<li><div class="list list-hoof">' + (i+1) + '</div><div class="clueName clueName-hoof">' + response.content.list[i].ajmc + '</div><div class="clue clue-hoof">' + clue + '</div><div class="entry entry-hoof">' + entry + '</div><div class="status">' + status + '</div></li>');
                    }
                    for(var i = 0; i < $('.clue-hoof').length; i++){
                        $('.clue-hoof:eq(' + i + ')').parent().children('.list-hoof').css({height: $('.clue-hoof:eq(' + i + ')').height() + 'px',lineHeight: $('.clue-hoof:eq(' + i + ')').height() + 'px'});
                        $('.clue-hoof:eq(' + i + ')').parent().children('.clueName-hoof').css({height: $('.clue-hoof:eq(' + i + ')').height() + 'px',lineHeight: $('.clue-hoof:eq(' + i + ')').height() + 'px'});
                    }
                    $('#demo_pag2').bs_pagination({
                        totalPages: response.content.pages,
                        visiblePageLinks: 8,
                        currentPage: response.content.pageNum,
                        showGoToPage: false,
                        showRowsPerPage: false,
                        showRowsInfo: false,
                        showRowsDefaultInfo: false,
                        navListContainerClass: 'col-xs-12',
                        onChangePage: function (event, data) {
                            $.ajax({
                                type: 'get',
                                url: baseUrls + 'clueCheck/checkOrder',
                                data: {userid: $('#userId').val(),checktime: $('.Select').val(), lrrname: $.trim($('#Input').val()),pageIndex: data.currentPage,pageSize: length},
                                beforeSend: function(){
                                    Loading();
                                },
                                success: function(response){
                                    closeLoading();
                                    if(response.responseCode == '1000'){
                                        $('.secondContent-hoof').html('');
                                        for(var i = 0; i < response.content.list.length; i++){
                                            var clue = '',
                                                entry  = '',
                                                status = '';
                                            for(var j = 0; j < response.content.list[i].clueList.length; j++){
                                                clue += '<span class="clueList"  onclick="showDetail(\''+ response.content.list[i].ajbh +'\')">' + nulls(response.content.list[i].clueList[j].qzmc)+'</span>';
                                                entry += '<span class="entryList">' + nulls(response.content.list[i].clueList[j].lrrname) + '</span>';
                                                if(response.content.list[i].clueList[j].checkstatus == '2'){
                                                    status += '<span class="statusList">通过</span>';
                                                }else{
                                                    if(response.content.list[i].clueList[j].checkdesc != null){
                                                        status += '<span class="statusList">驳回：'+ response.content.list[i].clueList[j].checkdesc +'</span>';
                                                    }else{
                                                        status += '<span class="statusList">驳回</span>';
                                                    }
                                                }
                                            }
                                            $('.secondContent-hoof').append('<li><div class="list list-hoof">' + (i+1) + '</div><div class="clueName clueName-hoof">' + response.content.list[i].ajmc + '</div><div class="clue clue-hoof">' + clue + '</div><div class="entry entry-hoof">' + entry + '</div><div class="status">' + status + '</div></li>');
                                        }
                                        for(var i = 0; i < $('.clue-hoof').length; i++){
                                            $('.clue-hoof:eq(' + i + ')').parent().children('.list-hoof').css({height: $('.clue-hoof:eq(' + i + ')').height() + 'px',lineHeight: $('.clue-hoof:eq(' + i + ')').height() + 'px'});
                                            $('.clue-hoof:eq(' + i + ')').parent().children('.clueName-hoof').css({height: $('.clue-hoof:eq(' + i + ')').height() + 'px',lineHeight: $('.clue-hoof:eq(' + i + ')').height() + 'px'});
                                        }
                                    }else{
                                        Msg();
                                    }
                                },
                                error: function(){
                                    closeLoading();
                                    Msg();
                                }
                            })
                        }
                    });
                }else{
                    $('.secondContent-hoof').html('');
                    $('#demo_pag2').html('');
                  //  Msg('暂无数据');
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//指令审核列表
function commandCheckList(){
    $('.secondContent-hoof').css({height: h - 630 + 'px'});
    var length = Math.floor(239 / 49);
    $.ajax({
        type: 'get',
        url: baseUrls + 'commandCheckList',
        data: {
            userid: $('#userId').val(),
            pageIndex: 1,
            pageSize: length
        },
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                if(response.content.list.length > 0){
                    $('.threeContent-hoof').html('');
                    for(var i = 0; i < response.content.list.length; i++){
                        var status = '',//同意与否按钮
                            edit = ''; //同意与否操作符
                        edit = '<span class="editList"><i class="fa fa-check check" aria-hidden="true" onclick="checkOrder(this)"></i>&nbsp&nbsp<i class="fa fa-times times" aria-hidden="true" onclick="refusedClue(this)"></i></span>';
                        status += '<div class="statusList"><div class="form-group"><input type="text" placeholder="" maxlength="30" class="form-control Input" onkeyup="valLength(this)"><label class="Labels LabelFirst" onclick="msgSures(this)">确定</label><label class="Labels" onclick="msgCancel(this)">取消</label></div></div>';
                        $('.threeContent-hoof').append('<li><div class="list list-hoof orderLineHeight">' + (i+1) + '</div><div class="clueName clueName-hoof orderLineHeight" style="cursor:pointer;" onclick="orderDetail(\''+ response.content.list[i].COMID +'\')">' + nulls(response.content.list[i].COMNAME) + '</div><div class="clue clue-hoof orderLineHeight" title="'+ nulls(response.content.list[i].COMCONTENT) +'">' + nulls(response.content.list[i].COMCONTENT) + '</div><div class="entry entry-hoof orderLineHeight">' + nulls(response.content.list[i].SENDNAME) + '</div><div class="edit edit-hoof">' + edit + '</div><div class="status orderStatus status-hoof">' + status + '</div><input type="hidden" class="comid" value="'+ nulls(response.content.list[i].COMID) +'"></li>');
                    }
                    $('#demo_pag3').bs_pagination({
                        totalPages: response.content.pages,
                        visiblePageLinks: 8,
                        currentPage: response.content.pageNum,
                        showGoToPage: false,
                        showRowsPerPage: false,
                        showRowsInfo: false,
                        showRowsDefaultInfo: false,
                        navListContainerClass: 'col-xs-12',
                        onChangePage: function (event, data) {
                            $.ajax({
                                type: 'get',
                                url: baseUrls + 'commandCheckList',
                                data: {
                                    userid: $('#userId').val(),
                                    pageIndex: data.currentPage,
                                    pageSize: length
                                },
                                beforeSend: function(){
                                    Loading();
                                },
                                success: function(response){
                                    closeLoading();
                                    if(response.responseCode == '1000'){
                                        $('.threeContent-hoof').html('');
                                        if(response.content.list.length > 0){
                                            for(var i = 0; i < response.content.list.length; i++){
                                                var status = '',//同意与否按钮
                                                    edit = ''; //同意与否操作符
                                                edit = '<span class="editList"><i class="fa fa-check check" aria-hidden="true" onclick="checkOrder(this)"></i>&nbsp&nbsp<i class="fa fa-times times" aria-hidden="true" onclick="refusedClue(this)"></i></span>';
                                                status += '<div class="statusList"><div class="form-group"><input type="text" placeholder="" maxlength="30" class="form-control Input" onkeyup="valLength(this)"><label class="Labels LabelFirst" onclick="msgSures(this)">确定</label><label class="Labels" onclick="msgCancel(this)">取消</label></div></div>';
                                                $('.threeContent-hoof').append('<li><div class="list list-hoof orderLineHeight">' + (i+1) + '</div><div class="clueName clueName-hoof orderLineHeight" style="cursor:pointer;" onclick="orderDetail(\''+ response.content.list[i].COMID +'\')">' + nulls(response.content.list[i].COMNAME) + '</div><div class="clue clue-hoof orderLineHeight" title="'+ nulls(response.content.list[i].COMCONTENT) +'">' + nulls(response.content.list[i].COMCONTENT) + '</div><div class="entry entry-hoof orderLineHeight">' + nulls(response.content.list[i].SENDNAME) + '</div><div class="edit edit-hoof">' + edit + '</div><div class="status orderStatus status-hoof">' + status + '</div><input type="hidden" class="comid" value="'+ nulls(response.content.list[i].COMID) +'"></li>');
                                            }
                                        }else{
                                            $('.threeContent-hoof').html('');
                                            $('#demo_pag3').html('');
                                         //   Msg('暂无数据');
                                        }
                                    }else{
                                        Msg();
                                    }
                                },
                                error: function(){
                                    closeLoading();
                                    Msg();
                                }
                            })
                        }
                    });
                }else{
                    $('.threeContent-hoof').html('');
                    $('#demo_pag3').html('');
                  //  Msg('暂无数据');
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//指令审核历史列表
function commandCheckRecord(){
    $('.fourContent-hoof').css({height: h - 630 + 'px'});
    var length = Math.floor($('.fourContent-hoof').height() / 49);
    $.ajax({
        type: 'get',
        url: baseUrls + 'commandCheckRecord',
        data: {
            userId: $('#userId').val(),
            checktime: $('.Selects').val(),
            lrr: $.trim($('#Inputs').val()),
            pageIndex: 1,
            pageSize: length
        },
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                if(response.content.list.length > 0){
                    $('.fourContent-hoof').html('');
                    for(var i = 0; i < response.content.list.length; i++){
                        var status = '';//说明
                        if(response.content.list[i].CHECKSTATUS == '1'){
                            status = '<span class=" statusLists newstatusListAgreen">通过</span>';
                        }else{
                            if(response.content.list[i].CHECKDESC != null){
                                status = '<span class=" statusLists rejectSpan newstatusListDefault">驳回：'+ response.content.list[i].CHECKDESC +'</span>';
                            }else{
                                status = '<span class=" statusLists rejectSpan newstatusListDefault">驳回</span>';
                            }
                        }
                        $('.fourContent-hoof').append('<li><div class="list list-hoof orderLineHeight">' + (i+1) + '</div><div class="clueName clueName-hoof orderLineHeight" style="cursor:pointer;" onclick="orderDetail(\''+ response.content.list[i].COMID +'\')">' + nulls(response.content.list[i].COMNAME) + '</div><div class="clue clue-hoof orderLineHeight" title="'+ nulls(response.content.list[i].COMCONTENT) +'">' + nulls(response.content.list[i].COMCONTENT) + '</div><div class="entry entry-hoof orderLineHeight">' + nulls(response.content.list[i].SENDNAME) + '</div><div class="status orderStatus status-hoof">' + status + '</div></li>');
                    }
                    $('#demo_pag4').bs_pagination({
                        totalPages: response.content.pages,
                        visiblePageLinks: 8,
                        currentPage: response.content.pageNum,
                        showGoToPage: false,
                        showRowsPerPage: false,
                        showRowsInfo: false,
                        showRowsDefaultInfo: false,
                        navListContainerClass: 'col-xs-12',
                        onChangePage: function (event, data) {
                            $.ajax({
                                type: 'get',
                                url: baseUrls + 'commandCheckRecord',
                                data: {
                                    userId: $('#userId').val(),
                                    checktime: $('.Selects').val(),
                                    lrr: $.trim($('#Inputs').val()),
                                    pageIndex: data.currentPage,
                                    pageSize: length
                                },
                                beforeSend: function(){
                                    Loading();
                                },
                                success: function(response){
                                    closeLoading();
                                    if(response.responseCode == '1000'){
                                        if(response.content.list.length > 0){
                                            $('.fourContent-hoof').html('');
                                            for(var i = 0; i < response.content.list.length; i++){
                                                var status = '';//说明
                                                if(response.content.list[i].CHECKSTATUS == '1'){
                                                    status = '<span class=" statusLists newstatusListAgreen">通过</span>';
                                                }else{
                                                    if(response.content.list[i].CHECKDESC != null){
                                                        status = '<span class=" statusLists rejectSpan newstatusListDefault">驳回：'+ response.content.list[i].CHECKDESC +'</span>';
                                                    }else{
                                                        status = '<span class=" statusLists rejectSpan newstatusListDefault">驳回</span>';
                                                    }
                                                }
                                                $('.fourContent-hoof').append('<li><div class="list list-hoof orderLineHeight">' + (i+1) + '</div><div class="clueName clueName-hoof orderLineHeight" style="cursor:pointer;" onclick="orderDetail(\''+ response.content.list[i].COMID +'\')">' + nulls(response.content.list[i].COMNAME) + '</div><div class="clue clue-hoof orderLineHeight" title="'+ nulls(response.content.list[i].COMCONTENT) +'">' + nulls(response.content.list[i].COMCONTENT) + '</div><div class="entry entry-hoof orderLineHeight">' + nulls(response.content.list[i].SENDNAME) + '</div><div class="status orderStatus status-hoof">' + status + '</div></li>');
                                            }
                                        }else{
                                            $('.fourContent-hoof').html('');
                                            $('#demo_pag4').html('');
                                          //  Msg('暂无数据');
                                        }
                                    }else{
                                        Msg();
                                    }
                                },
                                error: function(){
                                    closeLoading();
                                    Msg();
                                }
                            })
                        }
                    });
                }else{
                    $('.fourContent-hoof').html('');
                    $('#demo_pag4').html('');
                   // Msg('暂无数据');
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//串并审核列表
function caseCodeCheckList(pageIndex){
    $('.sixContent-hoof').css({height: h - 630 + 'px'});
    var length = Math.floor(239 / 49);
    $.ajax({
        type: 'get',
        cache: false,
        url: baseUrls + 'homepage/glaj',
        data: {
            shzt: '0',
            pageIndex: pageIndex,
            pageSize: length
        },
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                if(response.content.list.length > 0){
                    $('.fiveContent-hoof').html('');
                    response.content.list.forEach(function(item,index){
                        var status = '',//同意与否按钮
                            edit = '', //同意与否操作符
                            span = '';//案件列表
                        item.ajbhs.split(',').forEach(function(items,indexs){
                            span += '<span onclick="showDetail(\''+ items +'\')">'+ items +'</span>';
                        });
                        edit = '<span class="editList"><i class="fa fa-check check" aria-hidden="true" onclick="caseCodeOrder(this)"></i>&nbsp&nbsp<i class="fa fa-times times" aria-hidden="true" onclick="refusedClue(this)"></i></span>';
                        status += '<div class="statusList"><div class="form-group"><input type="text" placeholder="" maxlength="30" class="form-control Input" onkeyup="valLength(this)"><label class="Labels LabelFirst" onclick="caseCodeMsgSure(this)">确定</label><label class="Labels" onclick="msgCancel(this)">取消</label></div></div>';
                        $('.fiveContent-hoof').append('<li><div class="list list-hoof orderLineHeight">' + (index + 1) + '</div><div class="clueName clueName-hoof orderLineHeight" id="'+ index +'">' + span + '</div><div class="entry entry-hoof orderLineHeight">' + nulls(item.ccjr) + '</div><div class="edit edit-hoof">' + edit + '</div><div class="status orderStatus status-hoof">' + status + '</div><input type="hidden" class="comid" value="'+ nulls(item.glbh) +'"></li>');
                    })
                    $('#demo_pag5').bs_pagination({
                        totalPages: response.content.pages,
                        visiblePageLinks: 8,
                        currentPage: response.content.pageNum,
                        showGoToPage: false,
                        showRowsPerPage: false,
                        showRowsInfo: false,
                        showRowsDefaultInfo: false,
                        navListContainerClass: 'col-xs-12',
                        onChangePage: function (event, data) {
                            caseCodeCheckList(data.currentPage);
                        }
                    });
                }else{
                    $('.fiveContent-hoof').html('');
                    $('#demo_pag5').html('');
                   // Msg('暂无数据');
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}
//串并审核历史列表
function caseCodeCheckRecord(pageIndex){
    $('.sixContent-hoof').css({height: h - 630 + 'px'});
    var length = Math.floor($('.sixContent-hoof').height() / 49);
    $.ajax({
        type: 'get',
        url: baseUrls + 'homepage/glaj',
        data: {
            shsj: $('.Selectss').val(),
            shr: $('#userId').val(),
            cjr: $.trim($('#Inputss').val()),
            shzt: '2,3',
            pageIndex: pageIndex,
            pageSize: length
        },
        beforeSend: function(){
            Loading();
        },
        success: function(response){
            closeLoading();
            if(response.responseCode == '1000'){
                if(response.content.list.length > 0){
                    $('.sixContent-hoof').html('');
                    response.content.list.forEach(function(item,index){
                        var status = '',//说明
                            span = '';//案件列表
                        item.ajbhs.split(',').forEach(function(items,indexs){
                            span += '<span onclick="showDetail(\''+ items +'\')">'+ items +'</span>';
                        });
                        if(item.shzt == '2'){
                            status = '<span class=" statusLists newstatusListAgreen">通过</span>';
                        }else{
                            if(item.shyj != null){
                                status = '<span class=" statusLists rejectSpan newstatusListDefault">驳回：'+ item.shyj +'</span>';
                            }else{
                                status = '<span class=" statusLists rejectSpan newstatusListDefault">驳回</span>';
                            }
                        }
                        $('.sixContent-hoof').append('<li><div class="list list-hoof orderLineHeight">' + (index + 1) + '</div><div class="clueName clueName-hoof orderLineHeight" id="'+ index +'">' + span + '</div><div class="entry entry-hoof orderLineHeight">' + nulls(item.ccjr) + '</div><div class="status orderStatus status-hoof">' + status + '</div></li>');
                    })
                    $('#demo_pag6').bs_pagination({
                        totalPages: response.content.pages,
                        visiblePageLinks: 8,
                        currentPage: response.content.pageNum,
                        showGoToPage: false,
                        showRowsPerPage: false,
                        showRowsInfo: false,
                        showRowsDefaultInfo: false,
                        navListContainerClass: 'col-xs-12',
                        onChangePage: function (event, data) {
                            caseCodeCheckRecord(data.currentPage);
                        }
                    });
                }else{
                    $('.sixContent-hoof').html('');
                    $('#demo_pag6').html('');
                   // Msg('暂无数据');
                }
            }else{
                Msg();
            }
        },
        error: function(){
            closeLoading();
            Msg();
        }
    })
}